package tech.aistar.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.aistar.dto.RankUser;
import tech.aistar.entity.Level;
import tech.aistar.entity.Urand;
import tech.aistar.entity.User;
import tech.aistar.mapper.UrankMapper;
import tech.aistar.service.IUrankService;

import java.util.ArrayList;
import java.util.List;
@Service
public class UrankServiceImpl implements IUrankService {
    @Autowired
    private UrankMapper urankMapper;
    @Autowired
    private LevelServiceImpl levelService;
//    @Override
//    public List<Urand> findJavaRank() {
//        return urankMapper.findJavaRank();
//    }

    @Override
    public List<Urand> findScore() {
        return urankMapper.findScore();
    }

    @Override
    public Integer findlevel() {
        return urankMapper.findlevel();
    }

    @Override
    public List<Urand> findScore1() {
        return urankMapper.findScore1();
    }

    @Override
    public List<Urand> findScore2() {
        return urankMapper.findScore2();
    }

    @Override
    public List<Urand> findScore3() {
        return urankMapper.findScore3();
    }

    @Override
    public List<Urand> findScore4() {
        return urankMapper.findScore4();
    }

//    public List<RankUser> findRank(){
//        List<RankUser> lists = new ArrayList<>();
//        List<Urand> urands = findJavaRank();
//        System.out.println(urands);
//        for (Urand u : urands) {
//            RankUser rankUser = new RankUser();
//            Level level = levelService.findUserlevel(String.valueOf(u.getRankUid()));
//            rankUser.setUname(u.getRankUname());
//            rankUser.setRankrid(u.getRankRid());
//            rankUser.setuLevel(level.getLevelUlevel());
//            lists.add(rankUser);
//        }
//        return lists;
//    }
}
